Skip to content

Conversation

RReichert
Copy link
Contributor

@RReichert RReichert commented May 7, 2025

Changes

I'm adding a new build flag which controls what C++ version it will use across the entire codebase, including third party libraries. By default Bazel uses C++14 (implicitly, even in third party libraries), which normally won't be a problem if it wasn't for the fact that the newest protobuf library which we are introducing didn't have have a problem with this, specifically Abseil.

Repositories can now run:

$ bazel build --@rules_swiftnav//:global_cxx_standard=17 //...

Which compiles everything with the C++17 standard. Options for C++20 and C++23 have been added as well.

@RReichert RReichert requested a review from a team as a code owner May 7, 2025 04:21
@RReichert RReichert force-pushed the rodrigor/upgrade-grpc branch from 510ab70 to ffc960a Compare May 7, 2025 04:23
# The whole codebase should build with c++14
"-std=c++14",
]
cxx_flags = select({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this compare to https://github.com/swift-nav/rules_swiftnav/blob/main/cc/defs.bzl#L62 ? I actually wasn't aware of the flag directly in the toolchain file.

Copy link
Contributor Author

@RReichert RReichert May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with what is highlighted here, if you use the bazel cc_library or cc_binary directly it will impose the "global cxx standard". in the code snippet that you posted, that only applies to swift_cc_library and swift_cc_binary targets and overrules the global setting.

@RReichert RReichert requested a review from sbmueller May 13, 2025 13:05
@RReichert RReichert changed the title Global C++ version Update protobuf to v25.1 May 13, 2025
@RReichert RReichert requested a review from a team May 14, 2025 01:01
@RReichert RReichert merged commit 0bf7940 into main May 14, 2025
1 check passed
@RReichert RReichert deleted the rodrigor/upgrade-grpc branch May 14, 2025 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants